//
//  SAWHomeworkTabCell.m
//  优学荟管理系统
//
//  Created by edz on 2018/1/26.
//  Copyright © 2018年 星道三好. All rights reserved.
//

#import "SAWHomeworkTabCell.h"

@implementation SAWHomeworkTabCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setUI];
    }
    return self;
}
-(void)setUI
{
    _titLab = [[UILabel alloc]init];
    [self.contentView addSubview:_titLab];
    [_titLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15);
        make.top.offset(15);
    }];
    
    
    
        _Btn = [[UIButton alloc]init];
        [self.contentView addSubview:_Btn];
    [_Btn setTitleColor:[UIColor grayColor] forState:0];
        _Btn.backgroundColor=RGBColor(245, 245, 245);
        [_Btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(15);
            make.top.equalTo(_titLab.mas_bottom).offset(15);
            make.right.offset(-15);
            make.height.offset(40);
        }];
    
    __weak typeof(self) weakSelf = self;
    
    self.edicell = ^{
        [weakSelf.Btn removeFromSuperview];
        weakSelf.filed = [[UITextField alloc]init];
        [weakSelf.contentView addSubview:weakSelf.filed];
        weakSelf.filed.backgroundColor=RGBColor(245, 245, 245);
        weakSelf.filed.textAlignment=1;
        [weakSelf.filed mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(15);
            make.top.equalTo(weakSelf.titLab.mas_bottom).offset(15);
            make.right.offset(-15);
            make.height.offset(40);
        }];
    };
   
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
